3.2.96 \(\int \sec (e+f x) (a+a \sec (e+f x))^2 (c+d \sec (e+f x)) \, dx\) [196]

3.2.96.1 Optimal result
3.2.96.2 Mathematica [A] (verified)
3.2.96.3 Rubi [A] (verified)
3.2.96.4 Maple [A] (verified)
3.2.96.5 Fricas [A] (verification not implemented)
3.2.96.6 Sympy [F]
3.2.96.7 Maxima [A] (verification not implemented)
3.2.96.8 Giac [A] (verification not implemented)
3.2.96.9 Mupad [B] (verification not implemented)

3.2.96.1 Optimal result

Integrand size = 29, antiderivative size = 103 \[ \int \sec (e+f x) (a+a \sec (e+f x))^2 (c+d \sec (e+f x)) \, dx=\frac {a^2 (3 c+2 d) \text {arctanh}(\sin (e+f x))}{2 f}+\frac {2 a^2 (3 c+2 d) \tan (e+f x)}{3 f}+\frac {a^2 (3 c+2 d) \sec (e+f x) \tan (e+f x)}{6 f}+\frac {d (a+a \sec (e+f x))^2 \tan (e+f x)}{3 f} \]

output
1/2*a^2*(3*c+2*d)*arctanh(sin(f*x+e))/f+2/3*a^2*(3*c+2*d)*tan(f*x+e)/f+1/6 
*a^2*(3*c+2*d)*sec(f*x+e)*tan(f*x+e)/f+1/3*d*(a+a*sec(f*x+e))^2*tan(f*x+e) 
/f
 
3.2.96.2 Mathematica [A] (verified)

Time = 0.73 (sec) , antiderivative size = 63, normalized size of antiderivative = 0.61 \[ \int \sec (e+f x) (a+a \sec (e+f x))^2 (c+d \sec (e+f x)) \, dx=\frac {a^2 \left ((9 c+6 d) \text {arctanh}(\sin (e+f x))+\tan (e+f x) \left (12 (c+d)+3 (c+2 d) \sec (e+f x)+2 d \tan ^2(e+f x)\right )\right )}{6 f} \]

input
Integrate[Sec[e + f*x]*(a + a*Sec[e + f*x])^2*(c + d*Sec[e + f*x]),x]
 
output
(a^2*((9*c + 6*d)*ArcTanh[Sin[e + f*x]] + Tan[e + f*x]*(12*(c + d) + 3*(c 
+ 2*d)*Sec[e + f*x] + 2*d*Tan[e + f*x]^2)))/(6*f)
 
3.2.96.3 Rubi [A] (verified)

Time = 0.56 (sec) , antiderivative size = 92, normalized size of antiderivative = 0.89, number of steps used = 11, number of rules used = 10, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.345, Rules used = {3042, 4489, 3042, 4275, 3042, 4254, 24, 4534, 3042, 4257}

Below are the steps used by Rubi to obtain the solution. The rule number used for the transformation is given above next to the arrow. The rules definitions used are listed below.

\(\displaystyle \int \sec (e+f x) (a \sec (e+f x)+a)^2 (c+d \sec (e+f x)) \, dx\)

\(\Big \downarrow \) 3042

\(\displaystyle \int \csc \left (e+f x+\frac {\pi }{2}\right ) \left (a \csc \left (e+f x+\frac {\pi }{2}\right )+a\right )^2 \left (c+d \csc \left (e+f x+\frac {\pi }{2}\right )\right )dx\)

\(\Big \downarrow \) 4489

\(\displaystyle \frac {1}{3} (3 c+2 d) \int \sec (e+f x) (\sec (e+f x) a+a)^2dx+\frac {d \tan (e+f x) (a \sec (e+f x)+a)^2}{3 f}\)

\(\Big \downarrow \) 3042

\(\displaystyle \frac {1}{3} (3 c+2 d) \int \csc \left (e+f x+\frac {\pi }{2}\right ) \left (\csc \left (e+f x+\frac {\pi }{2}\right ) a+a\right )^2dx+\frac {d \tan (e+f x) (a \sec (e+f x)+a)^2}{3 f}\)

\(\Big \downarrow \) 4275

\(\displaystyle \frac {1}{3} (3 c+2 d) \left (2 a^2 \int \sec ^2(e+f x)dx+\int \sec (e+f x) \left (\sec ^2(e+f x) a^2+a^2\right )dx\right )+\frac {d \tan (e+f x) (a \sec (e+f x)+a)^2}{3 f}\)

\(\Big \downarrow \) 3042

\(\displaystyle \frac {1}{3} (3 c+2 d) \left (2 a^2 \int \csc \left (e+f x+\frac {\pi }{2}\right )^2dx+\int \csc \left (e+f x+\frac {\pi }{2}\right ) \left (\csc \left (e+f x+\frac {\pi }{2}\right )^2 a^2+a^2\right )dx\right )+\frac {d \tan (e+f x) (a \sec (e+f x)+a)^2}{3 f}\)

\(\Big \downarrow \) 4254

\(\displaystyle \frac {1}{3} (3 c+2 d) \left (\int \csc \left (e+f x+\frac {\pi }{2}\right ) \left (\csc \left (e+f x+\frac {\pi }{2}\right )^2 a^2+a^2\right )dx-\frac {2 a^2 \int 1d(-\tan (e+f x))}{f}\right )+\frac {d \tan (e+f x) (a \sec (e+f x)+a)^2}{3 f}\)

\(\Big \downarrow \) 24

\(\displaystyle \frac {1}{3} (3 c+2 d) \left (\int \csc \left (e+f x+\frac {\pi }{2}\right ) \left (\csc \left (e+f x+\frac {\pi }{2}\right )^2 a^2+a^2\right )dx+\frac {2 a^2 \tan (e+f x)}{f}\right )+\frac {d \tan (e+f x) (a \sec (e+f x)+a)^2}{3 f}\)

\(\Big \downarrow \) 4534

\(\displaystyle \frac {1}{3} (3 c+2 d) \left (\frac {3}{2} a^2 \int \sec (e+f x)dx+\frac {2 a^2 \tan (e+f x)}{f}+\frac {a^2 \tan (e+f x) \sec (e+f x)}{2 f}\right )+\frac {d \tan (e+f x) (a \sec (e+f x)+a)^2}{3 f}\)

\(\Big \downarrow \) 3042

\(\displaystyle \frac {1}{3} (3 c+2 d) \left (\frac {3}{2} a^2 \int \csc \left (e+f x+\frac {\pi }{2}\right )dx+\frac {2 a^2 \tan (e+f x)}{f}+\frac {a^2 \tan (e+f x) \sec (e+f x)}{2 f}\right )+\frac {d \tan (e+f x) (a \sec (e+f x)+a)^2}{3 f}\)

\(\Big \downarrow \) 4257

\(\displaystyle \frac {1}{3} (3 c+2 d) \left (\frac {3 a^2 \text {arctanh}(\sin (e+f x))}{2 f}+\frac {2 a^2 \tan (e+f x)}{f}+\frac {a^2 \tan (e+f x) \sec (e+f x)}{2 f}\right )+\frac {d \tan (e+f x) (a \sec (e+f x)+a)^2}{3 f}\)

input
Int[Sec[e + f*x]*(a + a*Sec[e + f*x])^2*(c + d*Sec[e + f*x]),x]
 
output
(d*(a + a*Sec[e + f*x])^2*Tan[e + f*x])/(3*f) + ((3*c + 2*d)*((3*a^2*ArcTa 
nh[Sin[e + f*x]])/(2*f) + (2*a^2*Tan[e + f*x])/f + (a^2*Sec[e + f*x]*Tan[e 
 + f*x])/(2*f)))/3
 

3.2.96.3.1 Defintions of rubi rules used

rule 24
Int[a_, x_Symbol] :> Simp[a*x, x] /; FreeQ[a, x]
 

rule 3042
Int[u_, x_Symbol] :> Int[DeactivateTrig[u, x], x] /; FunctionOfTrigOfLinear 
Q[u, x]
 

rule 4254
Int[csc[(c_.) + (d_.)*(x_)]^(n_), x_Symbol] :> Simp[-d^(-1)   Subst[Int[Exp 
andIntegrand[(1 + x^2)^(n/2 - 1), x], x], x, Cot[c + d*x]], x] /; FreeQ[{c, 
 d}, x] && IGtQ[n/2, 0]
 

rule 4257
Int[csc[(c_.) + (d_.)*(x_)], x_Symbol] :> Simp[-ArcTanh[Cos[c + d*x]]/d, x] 
 /; FreeQ[{c, d}, x]
 

rule 4275
Int[(csc[(e_.) + (f_.)*(x_)]*(d_.))^(n_.)*(csc[(e_.) + (f_.)*(x_)]*(b_.) + 
(a_))^2, x_Symbol] :> Simp[2*a*(b/d)   Int[(d*Csc[e + f*x])^(n + 1), x], x] 
 + Int[(d*Csc[e + f*x])^n*(a^2 + b^2*Csc[e + f*x]^2), x] /; FreeQ[{a, b, d, 
 e, f, n}, x]
 

rule 4489
Int[csc[(e_.) + (f_.)*(x_)]*(csc[(e_.) + (f_.)*(x_)]*(b_.) + (a_))^(m_)*(cs 
c[(e_.) + (f_.)*(x_)]*(B_.) + (A_)), x_Symbol] :> Simp[(-B)*Cot[e + f*x]*(( 
a + b*Csc[e + f*x])^m/(f*(m + 1))), x] + Simp[(a*B*m + A*b*(m + 1))/(b*(m + 
 1))   Int[Csc[e + f*x]*(a + b*Csc[e + f*x])^m, x], x] /; FreeQ[{a, b, A, B 
, e, f, m}, x] && NeQ[A*b - a*B, 0] && EqQ[a^2 - b^2, 0] && NeQ[a*B*m + A*b 
*(m + 1), 0] &&  !LtQ[m, -2^(-1)]
 

rule 4534
Int[(csc[(e_.) + (f_.)*(x_)]*(b_.))^(m_.)*(csc[(e_.) + (f_.)*(x_)]^2*(C_.) 
+ (A_)), x_Symbol] :> Simp[(-C)*Cot[e + f*x]*((b*Csc[e + f*x])^m/(f*(m + 1) 
)), x] + Simp[(C*m + A*(m + 1))/(m + 1)   Int[(b*Csc[e + f*x])^m, x], x] /; 
 FreeQ[{b, e, f, A, C, m}, x] && NeQ[C*m + A*(m + 1), 0] &&  !LeQ[m, -1]
 
3.2.96.4 Maple [A] (verified)

Time = 2.93 (sec) , antiderivative size = 120, normalized size of antiderivative = 1.17

method result size
parts \(\frac {\left (a^{2} c +2 a^{2} d \right ) \left (\frac {\sec \left (f x +e \right ) \tan \left (f x +e \right )}{2}+\frac {\ln \left (\sec \left (f x +e \right )+\tan \left (f x +e \right )\right )}{2}\right )}{f}+\frac {\left (2 a^{2} c +a^{2} d \right ) \tan \left (f x +e \right )}{f}+\frac {\ln \left (\sec \left (f x +e \right )+\tan \left (f x +e \right )\right ) a^{2} c}{f}-\frac {a^{2} d \left (-\frac {2}{3}-\frac {\sec \left (f x +e \right )^{2}}{3}\right ) \tan \left (f x +e \right )}{f}\) \(120\)
derivativedivides \(\frac {a^{2} c \left (\frac {\sec \left (f x +e \right ) \tan \left (f x +e \right )}{2}+\frac {\ln \left (\sec \left (f x +e \right )+\tan \left (f x +e \right )\right )}{2}\right )-a^{2} d \left (-\frac {2}{3}-\frac {\sec \left (f x +e \right )^{2}}{3}\right ) \tan \left (f x +e \right )+2 a^{2} c \tan \left (f x +e \right )+2 a^{2} d \left (\frac {\sec \left (f x +e \right ) \tan \left (f x +e \right )}{2}+\frac {\ln \left (\sec \left (f x +e \right )+\tan \left (f x +e \right )\right )}{2}\right )+a^{2} c \ln \left (\sec \left (f x +e \right )+\tan \left (f x +e \right )\right )+a^{2} d \tan \left (f x +e \right )}{f}\) \(145\)
default \(\frac {a^{2} c \left (\frac {\sec \left (f x +e \right ) \tan \left (f x +e \right )}{2}+\frac {\ln \left (\sec \left (f x +e \right )+\tan \left (f x +e \right )\right )}{2}\right )-a^{2} d \left (-\frac {2}{3}-\frac {\sec \left (f x +e \right )^{2}}{3}\right ) \tan \left (f x +e \right )+2 a^{2} c \tan \left (f x +e \right )+2 a^{2} d \left (\frac {\sec \left (f x +e \right ) \tan \left (f x +e \right )}{2}+\frac {\ln \left (\sec \left (f x +e \right )+\tan \left (f x +e \right )\right )}{2}\right )+a^{2} c \ln \left (\sec \left (f x +e \right )+\tan \left (f x +e \right )\right )+a^{2} d \tan \left (f x +e \right )}{f}\) \(145\)
parallelrisch \(\frac {\left (-\frac {9 \left (\cos \left (f x +e \right )+\frac {\cos \left (3 f x +3 e \right )}{3}\right ) \left (c +\frac {2 d}{3}\right ) \ln \left (\tan \left (\frac {f x}{2}+\frac {e}{2}\right )-1\right )}{2}+\frac {9 \left (\cos \left (f x +e \right )+\frac {\cos \left (3 f x +3 e \right )}{3}\right ) \left (c +\frac {2 d}{3}\right ) \ln \left (\tan \left (\frac {f x}{2}+\frac {e}{2}\right )+1\right )}{2}+\left (c +2 d \right ) \sin \left (2 f x +2 e \right )+\left (2 c +\frac {5 d}{3}\right ) \sin \left (3 f x +3 e \right )+2 \left (c +\frac {3 d}{2}\right ) \sin \left (f x +e \right )\right ) a^{2}}{f \left (\cos \left (3 f x +3 e \right )+3 \cos \left (f x +e \right )\right )}\) \(148\)
norman \(\frac {\frac {8 a^{2} \left (3 c +2 d \right ) \tan \left (\frac {f x}{2}+\frac {e}{2}\right )^{3}}{3 f}-\frac {a^{2} \left (3 c +2 d \right ) \tan \left (\frac {f x}{2}+\frac {e}{2}\right )^{5}}{f}-\frac {a^{2} \left (5 c +6 d \right ) \tan \left (\frac {f x}{2}+\frac {e}{2}\right )}{f}}{\left (\tan \left (\frac {f x}{2}+\frac {e}{2}\right )^{2}-1\right )^{3}}-\frac {a^{2} \left (3 c +2 d \right ) \ln \left (\tan \left (\frac {f x}{2}+\frac {e}{2}\right )-1\right )}{2 f}+\frac {a^{2} \left (3 c +2 d \right ) \ln \left (\tan \left (\frac {f x}{2}+\frac {e}{2}\right )+1\right )}{2 f}\) \(149\)
risch \(-\frac {i a^{2} \left (3 c \,{\mathrm e}^{5 i \left (f x +e \right )}+6 d \,{\mathrm e}^{5 i \left (f x +e \right )}-12 c \,{\mathrm e}^{4 i \left (f x +e \right )}-6 d \,{\mathrm e}^{4 i \left (f x +e \right )}-24 \,{\mathrm e}^{2 i \left (f x +e \right )} c -24 d \,{\mathrm e}^{2 i \left (f x +e \right )}-3 \,{\mathrm e}^{i \left (f x +e \right )} c -6 d \,{\mathrm e}^{i \left (f x +e \right )}-12 c -10 d \right )}{3 f \left (1+{\mathrm e}^{2 i \left (f x +e \right )}\right )^{3}}-\frac {3 a^{2} c \ln \left ({\mathrm e}^{i \left (f x +e \right )}-i\right )}{2 f}-\frac {a^{2} \ln \left ({\mathrm e}^{i \left (f x +e \right )}-i\right ) d}{f}+\frac {3 a^{2} c \ln \left ({\mathrm e}^{i \left (f x +e \right )}+i\right )}{2 f}+\frac {a^{2} \ln \left ({\mathrm e}^{i \left (f x +e \right )}+i\right ) d}{f}\) \(214\)

input
int(sec(f*x+e)*(a+a*sec(f*x+e))^2*(c+d*sec(f*x+e)),x,method=_RETURNVERBOSE 
)
 
output
(a^2*c+2*a^2*d)/f*(1/2*sec(f*x+e)*tan(f*x+e)+1/2*ln(sec(f*x+e)+tan(f*x+e)) 
)+(2*a^2*c+a^2*d)/f*tan(f*x+e)+1/f*ln(sec(f*x+e)+tan(f*x+e))*a^2*c-a^2*d/f 
*(-2/3-1/3*sec(f*x+e)^2)*tan(f*x+e)
 
3.2.96.5 Fricas [A] (verification not implemented)

Time = 0.27 (sec) , antiderivative size = 138, normalized size of antiderivative = 1.34 \[ \int \sec (e+f x) (a+a \sec (e+f x))^2 (c+d \sec (e+f x)) \, dx=\frac {3 \, {\left (3 \, a^{2} c + 2 \, a^{2} d\right )} \cos \left (f x + e\right )^{3} \log \left (\sin \left (f x + e\right ) + 1\right ) - 3 \, {\left (3 \, a^{2} c + 2 \, a^{2} d\right )} \cos \left (f x + e\right )^{3} \log \left (-\sin \left (f x + e\right ) + 1\right ) + 2 \, {\left (2 \, a^{2} d + 2 \, {\left (6 \, a^{2} c + 5 \, a^{2} d\right )} \cos \left (f x + e\right )^{2} + 3 \, {\left (a^{2} c + 2 \, a^{2} d\right )} \cos \left (f x + e\right )\right )} \sin \left (f x + e\right )}{12 \, f \cos \left (f x + e\right )^{3}} \]

input
integrate(sec(f*x+e)*(a+a*sec(f*x+e))^2*(c+d*sec(f*x+e)),x, algorithm="fri 
cas")
 
output
1/12*(3*(3*a^2*c + 2*a^2*d)*cos(f*x + e)^3*log(sin(f*x + e) + 1) - 3*(3*a^ 
2*c + 2*a^2*d)*cos(f*x + e)^3*log(-sin(f*x + e) + 1) + 2*(2*a^2*d + 2*(6*a 
^2*c + 5*a^2*d)*cos(f*x + e)^2 + 3*(a^2*c + 2*a^2*d)*cos(f*x + e))*sin(f*x 
 + e))/(f*cos(f*x + e)^3)
 
3.2.96.6 Sympy [F]

\[ \int \sec (e+f x) (a+a \sec (e+f x))^2 (c+d \sec (e+f x)) \, dx=a^{2} \left (\int c \sec {\left (e + f x \right )}\, dx + \int 2 c \sec ^{2}{\left (e + f x \right )}\, dx + \int c \sec ^{3}{\left (e + f x \right )}\, dx + \int d \sec ^{2}{\left (e + f x \right )}\, dx + \int 2 d \sec ^{3}{\left (e + f x \right )}\, dx + \int d \sec ^{4}{\left (e + f x \right )}\, dx\right ) \]

input
integrate(sec(f*x+e)*(a+a*sec(f*x+e))**2*(c+d*sec(f*x+e)),x)
 
output
a**2*(Integral(c*sec(e + f*x), x) + Integral(2*c*sec(e + f*x)**2, x) + Int 
egral(c*sec(e + f*x)**3, x) + Integral(d*sec(e + f*x)**2, x) + Integral(2* 
d*sec(e + f*x)**3, x) + Integral(d*sec(e + f*x)**4, x))
 
3.2.96.7 Maxima [A] (verification not implemented)

Time = 0.21 (sec) , antiderivative size = 167, normalized size of antiderivative = 1.62 \[ \int \sec (e+f x) (a+a \sec (e+f x))^2 (c+d \sec (e+f x)) \, dx=\frac {4 \, {\left (\tan \left (f x + e\right )^{3} + 3 \, \tan \left (f x + e\right )\right )} a^{2} d - 3 \, a^{2} c {\left (\frac {2 \, \sin \left (f x + e\right )}{\sin \left (f x + e\right )^{2} - 1} - \log \left (\sin \left (f x + e\right ) + 1\right ) + \log \left (\sin \left (f x + e\right ) - 1\right )\right )} - 6 \, a^{2} d {\left (\frac {2 \, \sin \left (f x + e\right )}{\sin \left (f x + e\right )^{2} - 1} - \log \left (\sin \left (f x + e\right ) + 1\right ) + \log \left (\sin \left (f x + e\right ) - 1\right )\right )} + 12 \, a^{2} c \log \left (\sec \left (f x + e\right ) + \tan \left (f x + e\right )\right ) + 24 \, a^{2} c \tan \left (f x + e\right ) + 12 \, a^{2} d \tan \left (f x + e\right )}{12 \, f} \]

input
integrate(sec(f*x+e)*(a+a*sec(f*x+e))^2*(c+d*sec(f*x+e)),x, algorithm="max 
ima")
 
output
1/12*(4*(tan(f*x + e)^3 + 3*tan(f*x + e))*a^2*d - 3*a^2*c*(2*sin(f*x + e)/ 
(sin(f*x + e)^2 - 1) - log(sin(f*x + e) + 1) + log(sin(f*x + e) - 1)) - 6* 
a^2*d*(2*sin(f*x + e)/(sin(f*x + e)^2 - 1) - log(sin(f*x + e) + 1) + log(s 
in(f*x + e) - 1)) + 12*a^2*c*log(sec(f*x + e) + tan(f*x + e)) + 24*a^2*c*t 
an(f*x + e) + 12*a^2*d*tan(f*x + e))/f
 
3.2.96.8 Giac [A] (verification not implemented)

Time = 0.32 (sec) , antiderivative size = 178, normalized size of antiderivative = 1.73 \[ \int \sec (e+f x) (a+a \sec (e+f x))^2 (c+d \sec (e+f x)) \, dx=\frac {3 \, {\left (3 \, a^{2} c + 2 \, a^{2} d\right )} \log \left ({\left | \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right ) + 1 \right |}\right ) - 3 \, {\left (3 \, a^{2} c + 2 \, a^{2} d\right )} \log \left ({\left | \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right ) - 1 \right |}\right ) - \frac {2 \, {\left (9 \, a^{2} c \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{5} + 6 \, a^{2} d \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{5} - 24 \, a^{2} c \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{3} - 16 \, a^{2} d \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{3} + 15 \, a^{2} c \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right ) + 18 \, a^{2} d \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )\right )}}{{\left (\tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{2} - 1\right )}^{3}}}{6 \, f} \]

input
integrate(sec(f*x+e)*(a+a*sec(f*x+e))^2*(c+d*sec(f*x+e)),x, algorithm="gia 
c")
 
output
1/6*(3*(3*a^2*c + 2*a^2*d)*log(abs(tan(1/2*f*x + 1/2*e) + 1)) - 3*(3*a^2*c 
 + 2*a^2*d)*log(abs(tan(1/2*f*x + 1/2*e) - 1)) - 2*(9*a^2*c*tan(1/2*f*x + 
1/2*e)^5 + 6*a^2*d*tan(1/2*f*x + 1/2*e)^5 - 24*a^2*c*tan(1/2*f*x + 1/2*e)^ 
3 - 16*a^2*d*tan(1/2*f*x + 1/2*e)^3 + 15*a^2*c*tan(1/2*f*x + 1/2*e) + 18*a 
^2*d*tan(1/2*f*x + 1/2*e))/(tan(1/2*f*x + 1/2*e)^2 - 1)^3)/f
 
3.2.96.9 Mupad [B] (verification not implemented)

Time = 16.21 (sec) , antiderivative size = 161, normalized size of antiderivative = 1.56 \[ \int \sec (e+f x) (a+a \sec (e+f x))^2 (c+d \sec (e+f x)) \, dx=\frac {2\,a^2\,\mathrm {atanh}\left (\frac {4\,\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )\,\left (\frac {3\,c}{2}+d\right )}{6\,c+4\,d}\right )\,\left (\frac {3\,c}{2}+d\right )}{f}-\frac {\left (3\,a^2\,c+2\,a^2\,d\right )\,{\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )}^5+\left (-8\,a^2\,c-\frac {16\,a^2\,d}{3}\right )\,{\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )}^3+\left (5\,a^2\,c+6\,a^2\,d\right )\,\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )}{f\,\left ({\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )}^6-3\,{\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )}^4+3\,{\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )}^2-1\right )} \]

input
int(((a + a/cos(e + f*x))^2*(c + d/cos(e + f*x)))/cos(e + f*x),x)
 
output
(2*a^2*atanh((4*tan(e/2 + (f*x)/2)*((3*c)/2 + d))/(6*c + 4*d))*((3*c)/2 + 
d))/f - (tan(e/2 + (f*x)/2)*(5*a^2*c + 6*a^2*d) + tan(e/2 + (f*x)/2)^5*(3* 
a^2*c + 2*a^2*d) - tan(e/2 + (f*x)/2)^3*(8*a^2*c + (16*a^2*d)/3))/(f*(3*ta 
n(e/2 + (f*x)/2)^2 - 3*tan(e/2 + (f*x)/2)^4 + tan(e/2 + (f*x)/2)^6 - 1))